﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Text;

/// <summary>
///Pub_Label 的摘要说明
///HTML文件内容里面的标签替换
///标签格式:{$tabname}
/// </summary>
public class Pub_Label : BasePage
{
    public Pub_Label()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }
    /// <summary>
    /// 标签替换,注意:区分大小写
    /// {$SiteName} -网站名称
    /// </summary>
    /// <param name="str">内容</param>
    public string Label_Replace(string str)
    {
        str = str.Replace("{$SiteName}", configInfo.SiteName);//网站名称
        return str;
    }
    /// <summary>
    /// 注册左边
    /// </summary>
    /// <param name="CurrStr">当前位置[1,2,3]</param>
    /// <returns></returns>
    public string RegLeft(int cur)
    {

        StringBuilder stb = new StringBuilder();

        string C = "<span Class=\"CurrReg\">→</span>";

        stb.AppendLine("<ul class=\"ul1\">");
        stb.AppendLine("<li><strong>·注册" + configInfo.SiteName + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></li>");
        stb.AppendLine("</ul>");
        stb.AppendLine("<ul class=\"ul2\">");
        stb.AppendLine("<li class=\"RegText\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注册步骤");
        stb.AppendLine("<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一、阅读并同意协议");
        if (cur == 1) { stb.Append(C); }
        stb.Append("</li>");

        stb.AppendLine("<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;二、填写注册资料");
        if (cur == 2) { stb.Append(C); }
        stb.Append("</li>");

        stb.AppendLine("<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;三、完成注册");
        if (cur == 3) { stb.Append(C); }
        stb.Append("</li>");

        stb.AppendLine("</ul>");
        return stb.ToString();
    }



    /// <summary>
    /// 是否禁止用户注册
    /// </summary>
    protected void IsNoReg()
    {
        StringBuilder stb = new StringBuilder();
        if (configInfo.EnableUserReg != 1)
        {
            stb.Append("网站已经暂时关闭新用户注册！");
            Response.Write(stb.ToString());
            Response.End();
        }


    }


}
